package com.systemframework.aspect;


import com.systemframework.exception.LicenseException;


import com.zmh.license.verify.LicenseVerify;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author summer
 * @date 2023-04-04 10:44
 */
@Component
@Aspect
@Slf4j
@Order(-1)
public class LicenseAspect {

    @Before(value = "@annotation(com.systemframework.annotation.LicenseAnnotation)")
    public void before(){
        if(!LicenseVerify.verify()){
            throw new LicenseException();
        }
    }
}
